From: | Andrew Bell |
Date: | 7 Sep 2001 at 23:10:59 |
Subject: | [amiga-c] Re: VB int problem (was Re: Help needed with random crashing problem) |
Hi Paul
On 07-Sep-01, you wrote:
> Well, I tracked down the problem to my vertical blank interrupt. I can't
> figure it out though, so I'm going to rewrite it in assembler or find
> another way to do volume control.
>
> Anyone got any ideas why a vb int written in Storm C might fail? I have
> __interrupt and __saveds, and I return(0) at the end too.
Don't forget that interrupts aren't executed on the context of your process,
but in supervisor mode. So don't assume that system structures will be
valid. Also, you can only use a small subset of exec functions. Signal() is
OK. But memory allocation, Wait()ing, etc. aren't allowed. I noticed that
you were trying to call printf() from inside your interrupt, this is a big
no no and the results can be fatal.
Basically keep the routine small and tight and don't do anything fancy. Plus
VERTB servers should return with the Z condition code set (this is
mentioned in the AddIntServer() autodoc).
You'd better read the RKMs on interrupts for more information, just to be on
the safe side.
Regards, Andrew Bell.
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Secure your servers with 128-bit SSL encryption! Grab your copy of VeriSign's FREE Guide: "Securing Your Web Site for Business." Get it Now!
http://us.click.yahoo.com/n7RbFC/zhwCAA/yigFAA/dpFolB/TM
---------------------------------------------------------------------~->
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/